<?php
class runtime 
{
	static protected $_begin=0;
	static protected $_end=0;
	static protected $_runtime=0;
	protected function _get_time()
	{
	    list($usec, $sec) = explode(" ",microtime()); 
    	return ((float)$usec + (float)$sec); 
	}
	static public function begin()
	{
	    self::$_begin = self::_get_time();
	    return (string)self::$_begin;
	}
	static public function done()
	{
	    self::$_end 	= self::_get_time();
	    self::$_runtime = self::$_end - self::$_begin;
	    return (string)self::$_runtime;
	}
	static public function end()
	{
	    if(!self::$_end)self::done();
	    return (string)self::$_end;
	}
	static public function get()
	{
	    return self::done();
	}
}
?>